UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YtzMjMMfmV82NDrHcLhvIdVQWHHipJ91SOzbaQ3sAsQ='
WHERE
key_id = '7c356668cd5b9b3c546fa480d3cdb1d9628a1edab4560893d094e8352a14861d'
AND (
token = 'YtzMjMMfmV82NDrHcLhvIdVQWHHipJ91SOzbaQ3sAsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)