UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q1QSR/AiEDzbvbYmiBK6h7PQQUPcSn2P/5iPFGASa1U=' 
WHERE 
  key_id = 'ffcfa8e4d0c2673aad7dd87757b79125e708295c7384393bf527b5f07d8bdf83' 
  AND (
    token = 'q1QSR/AiEDzbvbYmiBK6h7PQQUPcSn2P/5iPFGASa1U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028