UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xHOlHyReaU/GJnh3JHToLKzxIgnv1dUY+mHyMQIpm2E='
WHERE
key_id = 'f8c45c82c1e9569198985fefbd9b7a56ec2de0006d0bacf09389ebdb27f2d92a'
AND (
token = 'xHOlHyReaU/GJnh3JHToLKzxIgnv1dUY+mHyMQIpm2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)