UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vQViVaJN/DoyyPwib0cvXMKL00ukyUXg0a3zYlbdG8c=' 
WHERE 
  key_id = '75122451f4775f2782d0cee37a7158822e7ed955b40462e1813ef75baf38162c' 
  AND (
    token = 'vQViVaJN/DoyyPwib0cvXMKL00ukyUXg0a3zYlbdG8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036