UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CGSsnpZBZaICj9vNf0H/MeCHy2OpCmAjFqFclgjJ0a4=' 
WHERE 
  key_id = '2e30bf6d2f98b7ef2c86f39f48e222c21e1522d3979446e67ee6932294db9b67' 
  AND (
    token = 'CGSsnpZBZaICj9vNf0H/MeCHy2OpCmAjFqFclgjJ0a4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074