UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nlXyOLZSHPcx2qbEVGt12jvVfVT5WPwPxcbpBBs8uqU=' 
WHERE 
  key_id = '132ee6cb02598647a16a636891285415f732c90c9e2828151796234c3f7863f1' 
  AND (
    token = 'nlXyOLZSHPcx2qbEVGt12jvVfVT5WPwPxcbpBBs8uqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040