UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LjEDxSuk2Cp0hWMmeFyWayNBXs2BAQ7ruchd1rGKqxs=' 
WHERE 
  key_id = '72c8dd2bc273865f94658ae5761b0fc25f0351fb95e454a0b338559d61f65962' 
  AND (
    token = 'LjEDxSuk2Cp0hWMmeFyWayNBXs2BAQ7ruchd1rGKqxs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026