UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QmyBW7UXgtFG2XRFsSWmOCtV8v2zdNSCPRyqwQUf204='
WHERE
key_id = '2abbaec812525e92533daa0f145410b286ad18f7cf8ececd2f04a0f79a9fa0b7'
AND (
token = 'QmyBW7UXgtFG2XRFsSWmOCtV8v2zdNSCPRyqwQUf204='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)