UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5dr4zcTPeQSCrbSV4njrIyXjn+SyZcHr8CHVgPU3p/Y='
WHERE
key_id = '8d2d6084a83d19417a33e623d3f3f613a441e83c0588a33c1279f86420f24759'
AND (
token = '5dr4zcTPeQSCrbSV4njrIyXjn+SyZcHr8CHVgPU3p/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)