UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hNRcVTScRsc31kG33UG/Cf56Jw01ct7VnGojVewGTa0='
WHERE
key_id = '3caeb9685ff0e02294ac319fb66ce3b71ebbf829d462e529cc4ffee07690768c'
AND (
token = 'hNRcVTScRsc31kG33UG/Cf56Jw01ct7VnGojVewGTa0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)