UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yNRvjBIYEQdK8ctFDAVoWc4ASIpVJL3WxGn8IFHjx4Q='
WHERE
key_id = 'f53498be6fdb6c0d56d4b1f355cff11b6cafe4b0a1677421f1ec868054bdd90c'
AND (
token = 'yNRvjBIYEQdK8ctFDAVoWc4ASIpVJL3WxGn8IFHjx4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)