UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uT1TWgVLaI39wt2ffHxfqsoJZCXkSfXA5YvEiG2FQhQ='
WHERE
key_id = '0eddabb1d87ce709b2f0838d8849db80cefd435f98b6d904d8cb8707e49a4cb0'
AND (
token = 'uT1TWgVLaI39wt2ffHxfqsoJZCXkSfXA5YvEiG2FQhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)