UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LkVFj6x+1Fckgso5hEc/LT6DGf909xFBYb98xFla5kQ='
WHERE
key_id = 'e8cc7164cb054b9101fc458aa1e1aec7bcb574e7be228814fc01c13fd083e857'
AND (
token = 'LkVFj6x+1Fckgso5hEc/LT6DGf909xFBYb98xFla5kQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)