UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'juOkwgFKmICvpIWLblqqhpgTHohrOYCKXJMIBgpYPno='
WHERE
key_id = '159fe7befd73eb038cb14dc7aa47e38cffafb893c2b63c31553f06771db5b31a'
AND (
token = 'juOkwgFKmICvpIWLblqqhpgTHohrOYCKXJMIBgpYPno='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)