UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nX/jBqlQZlHZQ4j5zXwk08lHKG37CGv5vsfxSw4qWso=' 
WHERE 
  key_id = '4c203bc2973b898869228a0bfb725adddef3e79e4bd5e015d221b3bbedc524f9' 
  AND (
    token = 'nX/jBqlQZlHZQ4j5zXwk08lHKG37CGv5vsfxSw4qWso=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020