UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gC6HtFWNO7aq1AICYOgaEpRF29R8/sRCyn0PqWBTKzE=' 
WHERE 
  key_id = '3bae730fc2c01748a6d9d983981cb35a187ce313ef9dabf0a883d0231a7dce87' 
  AND (
    token = 'gC6HtFWNO7aq1AICYOgaEpRF29R8/sRCyn0PqWBTKzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030