UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IYHhMBaKYPWgsZPqwwDfsycLJuFGIMAvCH1E8vleb1U='
WHERE
key_id = '636274cbb413c902a3853bc7cdca475ff9eea33b8bc3a3d676bad49f38200ded'
AND (
token = 'IYHhMBaKYPWgsZPqwwDfsycLJuFGIMAvCH1E8vleb1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)