UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IW3QCmtD8vFSBqDoZPGiW/V57UgknZmlBXw15CRgocE='
WHERE
key_id = '0184f4dd5c6192a4903c2c8b3b8f68e755ce5a05e451ce3b33788084d7837f68'
AND (
token = 'IW3QCmtD8vFSBqDoZPGiW/V57UgknZmlBXw15CRgocE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)