UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VOFgQDrwLX5uvyGewDHCKr8fJJMmoHT5gvddzhYrpoM=' 
WHERE 
  key_id = '3c18ddeafb479763ee05830c009c20a2b426ece4e514e9fc27355c8b1fd64e56' 
  AND (
    token = 'VOFgQDrwLX5uvyGewDHCKr8fJJMmoHT5gvddzhYrpoM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039