UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/J/PmozDGKnVFzyuuRH9Hj1EGUdl4RsX5cg6WC3SWo4=' 
WHERE 
  key_id = '397333e63896e481fd2edc9fce7235b8304cf92eff4cfd54c72b0f1bf3cea81c' 
  AND (
    token = '/J/PmozDGKnVFzyuuRH9Hj1EGUdl4RsX5cg6WC3SWo4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028