UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't2/4iii5UWlU5yhclT9Vbvs0zr2xz2hhCRIC77RJikg=' 
WHERE 
  key_id = '46faf7540b3c83f8905cc050f4ef789f4353eac8ed073e5d5272f0044d4c13df' 
  AND (
    token = 't2/4iii5UWlU5yhclT9Vbvs0zr2xz2hhCRIC77RJikg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046