UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '831GHMJODZMKTzkgvn99xmzTBDMSCAyMzVktGdeyOWE='
WHERE
key_id = 'b0632d90bf466b62053db6bc8e3689709e8f2a30883059db0abbce73f6bf49cf'
AND (
token = '831GHMJODZMKTzkgvn99xmzTBDMSCAyMzVktGdeyOWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)