UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Bnp1kuB1+xWfcS2v0/jrNA1jrFMX2F+V2AFNgnr9Es='
WHERE
key_id = '3504cb62a2667c62ab6be1a491bb3d292f3184dad7fad5a2364a9f2178791aba'
AND (
token = '1Bnp1kuB1+xWfcS2v0/jrNA1jrFMX2F+V2AFNgnr9Es='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)