UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2FL0hmarWFkCQ7MvJsERBC4j9kBeOtgIBds0wJBCg34=' 
WHERE 
  key_id = '4eefcb7dcffa6a18be2e26f30b24fa9815dfb4f04b58242b36a898d90af54cd7' 
  AND (
    token = '2FL0hmarWFkCQ7MvJsERBC4j9kBeOtgIBds0wJBCg34=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032