UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's7f7VTEgQKYh24UwXcZnrZjuv5W8hTEYknyb9TckQNY='
WHERE
key_id = '5689f9e5a4e428cc6e21a4c647ccabaf307437de86d342206f929eb55e5cb5bd'
AND (
token = 's7f7VTEgQKYh24UwXcZnrZjuv5W8hTEYknyb9TckQNY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)