UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xu9fmzujA+cs6/OuYDC/ki2FRKNXbx5BTOgd1+mFit4='
WHERE
key_id = '91846daeae66a65bb3ea548c2b1c70f2845f359ee465a5e5e02c7fc92e43cfd0'
AND (
token = 'xu9fmzujA+cs6/OuYDC/ki2FRKNXbx5BTOgd1+mFit4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)