UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yib3lFkKbMV5DoquY8bad7dRxWDUf7BaF+xrwWRFASc=' 
WHERE 
  key_id = '046730af64047276487fbd7fa2e5ae26330842d2b313c0ac5598574cc478b0d4' 
  AND (
    token = 'yib3lFkKbMV5DoquY8bad7dRxWDUf7BaF+xrwWRFASc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034