UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cysHhX9qNkznX/iFXwPV6z9ko+Ppk5R3H1GiNl+k5dI=' 
WHERE 
  key_id = '9e4b283d00e2fbe13c5420b64d65ae15399c6d1eb57224adfaa0ea9de6676995' 
  AND (
    token = 'cysHhX9qNkznX/iFXwPV6z9ko+Ppk5R3H1GiNl+k5dI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00093