UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k452+BVoqBsmWPEc3z3UW8I67KPQfnDNnOplP5DavhE=' 
WHERE 
  key_id = 'e6d9abb750fe534fb04fccc4826cdb85c54daf0fe4804d006c9cfa8d71d280cd' 
  AND (
    token = 'k452+BVoqBsmWPEc3z3UW8I67KPQfnDNnOplP5DavhE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034