UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lO/Tlqrl3bbtmj60MSj57HQ892Pz68lnpUagLe6c4zo=' 
WHERE 
  key_id = 'bbf9ad12d3f6ec3d93aef358d9fc6aa4eced587082999c91518c25192497dfbd' 
  AND (
    token = 'lO/Tlqrl3bbtmj60MSj57HQ892Pz68lnpUagLe6c4zo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016