UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gfW01LHfkvUAPugAFCaD/+7hMXDRSLChlLbIyWZHVSM=' 
WHERE 
  key_id = 'ea948f421052e69e681435ec5f01f324538ea7b5440317fd7d8f62790f39f7f4' 
  AND (
    token = 'gfW01LHfkvUAPugAFCaD/+7hMXDRSLChlLbIyWZHVSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064