UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TnkRuMfYYBYASs/RW0fmm4PEvzluckLpwhbaUxh3qrU=' 
WHERE 
  key_id = '279d958d5d3060fbf61a4d8565d5bcf099f8a7af393354dade603c0f341a8375' 
  AND (
    token = 'TnkRuMfYYBYASs/RW0fmm4PEvzluckLpwhbaUxh3qrU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034