UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j8VlnbE7O10K0/o90KJncGhuXgVvBW2/ijPXTtY8Gh0='
WHERE
key_id = '3746e4c8be7acc97874cc01bdac2dba2fe9c2ab225393613538225abd98ccae8'
AND (
token = 'j8VlnbE7O10K0/o90KJncGhuXgVvBW2/ijPXTtY8Gh0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)