UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A62qJYZdvqUyVs211d5e8WgZ7TJNlFGAXtPnAcVvc5g='
WHERE
key_id = '5e28f9c80e1c15a3f8fbd8c393689fc2565389420fd0476364723c5678d2c6a3'
AND (
token = 'A62qJYZdvqUyVs211d5e8WgZ7TJNlFGAXtPnAcVvc5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)