UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dVXBj7bqcv8Gyv+F5fy+2vNp9A6Q8ae6gUQBIj6F0N8='
WHERE
key_id = '066a54438543692794cda66edfad2ffdad32af4ccdc3e4a2f87f95406f1c4472'
AND (
token = 'dVXBj7bqcv8Gyv+F5fy+2vNp9A6Q8ae6gUQBIj6F0N8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)