UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'utO8AyJg2meo6KPTFLdNYrFxWcMI5YLYwDVy1vAsL88=' 
WHERE 
  key_id = '90ef129e08d0092e1a6a81451ff1e5b66cbe621bbff940db57e6a747ca072425' 
  AND (
    token = 'utO8AyJg2meo6KPTFLdNYrFxWcMI5YLYwDVy1vAsL88=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048