UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oRKPMJcWNZG2xoThAoN8zs7z1IDrjvA+A0genMq1Psw='
WHERE
key_id = 'a08b6a5c115538668473e7746420b4248cdb3645d920f53f547e62e4f28afa95'
AND (
token = 'oRKPMJcWNZG2xoThAoN8zs7z1IDrjvA+A0genMq1Psw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)