UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yVQLJ9s1z5voLLV3bsBOXeSNgiLLtX+h8S/vwH1WlMc='
WHERE
key_id = 'a7822926ce6fed82bd2808719142b5395d35b8bebafc4921b758a0eba865ce2a'
AND (
token = 'yVQLJ9s1z5voLLV3bsBOXeSNgiLLtX+h8S/vwH1WlMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)