UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8S4iQCrBhzfFzoYD1gHingm4Nhmpk5t1pwuOZb6O7Ak=' 
WHERE 
  key_id = '9a37dbc52c22a291152c4848ecab2475cb64dd75ecb9b4ff0cc84d3f182b3102' 
  AND (
    token = '8S4iQCrBhzfFzoYD1gHingm4Nhmpk5t1pwuOZb6O7Ak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028