UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hbq4tMV/6ISO8ZiUO27Byumz0G4CLuJoTQuBDpQXf1A='
WHERE
key_id = '6d52c8ee9abb263253a778588e0eff4618fce3f769de2ff3c9e56dba729d5aed'
AND (
token = 'Hbq4tMV/6ISO8ZiUO27Byumz0G4CLuJoTQuBDpQXf1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)