UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WYVobGLGyKIvOyOYq1WjKtAmSabebH0o+KfjcTo7KdA=' 
WHERE 
  key_id = '45f0d3a840e85bef2d173e2c7799bf380517c4239e01b7d23954fe9d8d9b7d28' 
  AND (
    token = 'WYVobGLGyKIvOyOYq1WjKtAmSabebH0o+KfjcTo7KdA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035